import React from 'react'
import { connect } from 'dva'

import './style.css'

// nickname: '',
// headimgurl: ''

const UserCard = (user) => {
    console.log('userCard ', user.user.user)
    const { nickname, headimgurl } = user.user.user
    console.log(nickname, headimgurl)
    return (
        <div className='userCard'>
            <div 
                className='userCard-photo'
                style={{ backgroundImage: `url(${headimgurl})` }}
            />
            <div className='userCard-nickname'>
                {nickname}
            </div>
        </div>
    )
}

const mapState = state => ({
    user: state.user
})

export default connect(mapState)(UserCard)
